<?php

/**
  *
  * Copyright 2010 Universal Web Frameworks Project
  * Universal Security Platform API
  * 
  * Developed By : Mike Schmidt
  * Date Created : Jan , 17 , 2010
  * 
  */

/**
  *
  * Main Platform Control Library 
  * Version 1.0 Beta 1
  * 
  */



/**
  *
  * Main Platform Layer Validation Function
  * layercheck($id); -> Return Type -> List
  * 
  * Version 1.00
  * 
  */  

function layercheck($id){
	
	
	/**
	  *
	  * Function Information -> Beta 1
	  * 
	  * This function is meant to check to
	  * see if the current platform is able
	  * to use the requested layer. We must
	  * check the main config file to see if
	  * the request layer id is registered to
	  * work or not.
	  * 
	  */ 
      
      // Call Required Settings Config
      include "conf.php";
	  
	  // Explode The Current Config
	  $list = explode(":",$conf['layers'],"4");
	  
	  // Found The Requested Layer
	  if(in_array($id,$list) == "TRUE"){
		
		
		// Return Settings
		return "found";
		
		
	  }
	  
	  // Did Not Find The Requested Layer
	  else{
		
		
		// Return Settings
		return "Could not find the requested layer : $id";
		
		
	  }
	  
	  
}


/**
  *
  * Master Requested Layer Start Function
  * RunLayer($id,$cmd); -> Run-Time Error
  * 
  * Version 1.00
  * 
  */  

function RunLayer($id,$cmd){
	
	
    /**
      *
	  * Function Information Beta 1
	  * 
	  * This function is designed to start
	  * one layer at a time and then pass the
	  * current commands. At this current time
	  * we are only supporting 4 layers of info.
	  * 
	  * A. User Management
	  * B. Site Management
	  * C. Query Management
	  * D. WebApps Management
	  * 
	  */   	
	
	  
	/**
	  *
	  * User Management Layer
	  * 
	  */  
	  
	  if($id === "User"){
		
		 
		/**
		  *
		  * User Management Layer Information
		  * lib/user.php -> Beta 1
		  * 
		  * This layer will help you with all the basic
		  * user management tasks that you might have to
		  * deal with such as login and permission rights.
		  * 
		  */   
		  
		/**
		  *
		  * Start The Requested Layer 
		  * $user = User_API($info);
		  * 
		  */    
		  
		  // Required Layer Library
		  include "user.php";
		  
		  // Start The Platform Layer
		  $user = new User_API;
		  $user -> Start();
		  
		  
	  }
	
	
	/**
	  *
	  * Site Management Layer
	  * 
	  */  
	  
	  if($id === "Site"){
		
		
		
	  }
	  
	  
	/**
	  *
	  * Query Management Layer
	  * 
	  */    
	  
	  if($id === "Link"){
		
		
		
		
	  }
	  
	  
	/**
	  *
	  * WebApps Management Layer
	  * 
	  */    
	  
	  if($id === "Apps"){
		
		
		
		
	  }
	  
	  
}


?>